defmodule StringLib do
    @moduledoc false
    require Logger
    def to_exists_atom(str) when is_binary(str) do
        try do
            String.to_existing_atom(str)
        rescue
            err ->
                Logger.error("To Atom Error, str: #{str}, reason: #{inspect(err)}")
                :error
        end
    end
    def to_exists_atom(str) when is_atom(str) do
        str
    end
    def to_exists_atom(_) do
        :error
    end

end
